<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ page import="javax.faces.validator.ValidatorException" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page import="javax.transaction.UserTransaction" %>
<%@ page import="java.util.Date"
         import="java.text.DateFormat"
         import="java.text.SimpleDateFormat"
         %>

<%

            DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            DateFormat horaFormat = new SimpleDateFormat("HH:mm");
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Nueva Solicitudreserva</title>
        <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen">        
        <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css?random=20051112" media="screen"></link>
	<script type="text/javascript" src="<%=request.getContextPath()%>/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js?random=20060118"></script>

    </head>
    <body>
        <f:view>
            <%@ include file="/barra.jsp" %>
            
            <table width="1242" border="0">
                <tr>
                    <td width="21%" align="left" valign="top">
                        <!-- Divisor del Contenido Principal -->
                        <div id="siteName">                        </div>
                        <div id="content"> 
                            <div class="feature">
                                <jsp:directive.include file="/welcomeJSF.jsp" />
                            </div> 
                        </div> 
                        
                    <!-- Fin del Contenido Principal -->                  </td>
                    <td width="79%" align="left" valign="top">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        <h1>Nueva Solicitud Reserva</h1>
                        <h:form >
                            <h:inputHidden id="validateCreateField" validator="#{solicitudreserva.validateCreate}" value="value"/>
                            <h:panelGrid columns="2">
                                <h:outputText styleClass="label" value="Identificador:"/>
                                <h:inputText disabled="true" id="idsolicitudreserva" value="#{solicitudreserva.solicitudreserva.idSolicitudReserva}" title="Idsolicitudreserva" required="true" requiredMessage="The idsolicitudreserva field es requerido." />
                                
                                <h:outputText styleClass="label" value="Fecha/Hora Inicio(*):"/>
                                <input type="text" value=<%= dateFormat.format(new Date())%> readonly name="fechaInicio">
                                <input type="text" value=<%= horaFormat.format(new Date())%> readonly name="horaInicio">
                                <input type="button" value="Cal" onclick="displayCalendarMio(this.form.fechaInicio,this.form.horaInicio,'dd/mm/yyyy hh:ii',this,true)">
                                <h:outputText styleClass="label" value="Fecha/Hora Fin(*):"/>
                                <input type="text" value=<%= dateFormat.format(new Date())%> readonly name="fechaFin">
                                <input type="text" value=<%= horaFormat.format(new Date())%> readonly name="horaFin">
                                <input type="button" value="Cal" onclick="displayCalendarMio(this.form.fechaFin,this.form.horaFin,'dd/mm/yyyy hh:ii',this,true)">
                                
                                <h:inputHidden id="fechaaprobacion" value="#{solicitudreserva.solicitudreserva.fechaAprobacion}">
                                    <f:convertDateTime type="DATE" pattern="dd/MM/yyyy" />
                                </h:inputHidden>
                                
                                <h:inputHidden id="horaaprobacion" value="#{solicitudreserva.solicitudreserva.horaAprobacion}">
                                    <f:convertDateTime type="TIME" pattern="HH:mm" />
                                </h:inputHidden>
                                
                                <h:outputText styleClass="label" value="Tipo de Recurso(*):"/>
                                <h:selectOneMenu id="idtiporecurso" value="#{solicitudreserva.solicitudreserva.idTipoRecurso}" title="Idtiporecurso" required="true" requiredMessage="El tipo de recurso es requerido." >
                                    <f:selectItems value="#{tiporecurso.tiporecursosAvailableSelectOne}"/>
                                </h:selectOneMenu>

                                
                                <h:outputText styleClass="label" value="Observacion:"/>
                                <h:inputTextarea  rows="3" id="observacion" value="#{solicitudreserva.solicitudreserva.observacion}" title="Observacion" />
                                
                                <h:inputHidden id="idestadosolicitud" value="#{solicitudreserva.solicitudreserva.idEstadoSolicitud}">
                                </h:inputHidden>
                                
                                <h:inputHidden   id="idaprobador" value="#{solicitudreserva.solicitudreserva.idAprobador}" >
                                </h:inputHidden>
                            </h:panelGrid>
                            <br />
                            <br>
                            <b>"Los campos marcados con (*) son obligatorios"</b>
                            <br />
                            
                            <h:commandLink styleClass="boton" action="#{solicitudreserva.create}" value="[CREAR]"/>
                            <br />
                        </h:form>
                    </td>
                </tr>    
            </table>
            
            <%@ include file="/footer.jsp" %>
            
        </f:view>
    </body>
</html>
